package clock;

import clock.TimeCounter;

public class Second extends TimeCounter {
	private final static int MAX = 60;
	private TimeCounter parent;

	public Second(int time, TimeCounter parent) {
		super(time);
		this.parent = parent;
	}
	
	public void increase() {
		super.increase();
		if (count >= MAX) {
			count = 0;
			parent.increase();
		}
	}
	
	public void decrease() {
		super.decrease();
		if (count < 0) {
			count = MAX-1;
			parent.decrease();
		}
	}
}
